package com.zhongfl.crm.enums.boss;



import com.zhongfl.crm.exception.CRMException;
import lombok.Getter;

/**
 * 阿米巴成员角色枚举
 *
 * @author wang.yuchuan
 * @date 2018/5/3
 */
public enum AmibaStaffRole {

    MANAGER(10, "巴长"),
    MEMBER(20, "巴员");

    @Getter
    private int value;

    @Getter
    private String desc;

    AmibaStaffRole(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static AmibaStaffRole valueOf(int value) {
        for (AmibaStaffRole templateEnum : AmibaStaffRole.values()) {
            if (templateEnum.getValue() == value) {
                return templateEnum;
            }
        }
        throw new CRMException("没有在AmibaStaffRoleEnum找到枚举值为" + value + "的枚举");
    }
}
